package home.contaduria.service.impl;

import home.contaduria.dao.ExpenseTypeDao;
import home.contaduria.domain.Client;
import home.contaduria.domain.ExpenseType;
import home.contaduria.service.ExpenseTypeService;

import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("expenseTypeService")
public class ExpenseTypeServiceImpl implements ExpenseTypeService {
    private static final Logger logger = LoggerFactory.getLogger(ExpenseTypeServiceImpl.class);

    private ExpenseTypeDao expenseTypeDao;

    @Autowired
    public ExpenseTypeServiceImpl(ExpenseTypeDao expenseTypeDao) {
        this.expenseTypeDao = expenseTypeDao;
    }


    @Override
    @Transactional(readOnly = true, rollbackFor = Exception.class)
    public Collection<ExpenseType> loadClientExpenseTypes(Client client) {
        return expenseTypeDao.loadClientExpenseTypes(client);
    }

}
